package com.zhb.zhbojbackendserviceclient.service;


import com.zhb.zhbojbackendmodel.model.dto.questionsubmit.QuestionSubmitQueryDTO;
import com.zhb.zhbojbackendmodel.model.entity.Question;
import com.zhb.zhbojbackendmodel.model.entity.QuestionSubmit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**

*/
@FeignClient(name = "zhboj-backend-question-service", path = "/api/question/inner")
public interface QuestionFeignClient {
    /**
     * 根据查询条件批量获取题目提交列表
     *
     * @param questionSubmitQueryDTO
     * @return
     */
    @PostMapping("/question_submit/list")
    List<QuestionSubmit> list(@RequestBody QuestionSubmitQueryDTO questionSubmitQueryDTO);

    /**
     * 根据查询条件获取题目
     *
     * @param questionId
     * @return
     */
    @GetMapping("/get/one")
    Question getOne(@RequestParam("questionId") long questionId);

    @GetMapping("/get/id")
    Question getQuestionById(@RequestParam("questionId") long questionId);

    @PostMapping("/update")
    Boolean updateQuestionById(@RequestBody Question question);

    @GetMapping("/question_submit/get/id")
    QuestionSubmit getQuestionSubmitById(@RequestParam("questionId") long questionSubmitId);


    @PostMapping("/question_submit/update")
    boolean updateQuestionSubmitById(@RequestBody QuestionSubmit questionSubmit);

}
